using System.Collections.Generic;
using Guesshoo.TrainExpress.Extensions;

namespace Guesshoo.TrainExpress
{
	public class Station
	{
		private readonly string _stationName;

		public Station(string stationName) {
			_stationName = stationName;
			OutgoingStations = new List<Station>();
			IncomingStations = new List<Station>();
		}

		public string Name {
			get { return _stationName; }
		}

		public List<Station> OutgoingStations { get; set; }

		public List<Station> IncomingStations { get; set; }

		public override string ToString() {
			return "Station: {0}".FormatWith(_stationName);
		}

		public override bool Equals(object obj) {
			Station station = (Station) obj;
			if (station == null) {
				return false;
			}
			return station._stationName.Equals(_stationName);
		}

		public override int GetHashCode() {
			return _stationName.GetHashCode();
		}
	}
}